package com.example.demo.service;

import com.example.demo.mapper.UserMapper;
import com.example.demo.model.UserInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created with IntelliJ IDEA.
 * Description:
 */
@Service
public class UserService {

    // 使用注解注入UserMapper接口
    @Resource
    private UserMapper userMapper;

    // 实现根据用户 id 查询用户信息
    public UserInfo getUserById(Integer id) {
        return userMapper.getUserById(id);
    }
}
